package com.zhang.apipassenger.controller;

import com.zhang.apipassenger.request.ForecastPrceDTO;
import com.zhang.apipassenger.service.ForecastPriceService;
import com.zhang.internalcommon.dto.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ADMIN
 */
@RestController
@Slf4j
public class ForecastPriceController {
	@Autowired
	private ForecastPriceService forecastPriceService;

	@PostMapping("/forecast-price")
	public ResponseResult forecastPrice(@Validated @RequestBody ForecastPrceDTO forecastPrceDTO) {
		String depLongitude = forecastPrceDTO.getDepLongitude();
		String depLatitude = forecastPrceDTO.getDepLatitude();
		String destLongitude = forecastPrceDTO.getDestLongitude();
		String destLatitude = forecastPrceDTO.getDestLatitude();
		String cityCode = forecastPrceDTO.getCityCode();
		String vehicleType = forecastPrceDTO.getVehicleType();

		log.info("出发经度" + depLongitude);
		log.info("出发纬度" + depLatitude);
		log.info("目的经度" + destLongitude);
		log.info("目的纬度" + destLatitude);
		return forecastPriceService.forecastPrice(depLongitude, depLatitude, destLongitude, destLatitude,cityCode,vehicleType);
	}
}
